home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Pascal Super Library
/
Pascal Super Library (CW International)(1997).bin
/
DBASE_UT
/
TPDB335
/
SORTDEMO.PAS
< prev
next >
Wrap
Pascal/Delphi Source File
|
1993-11-26
|
2KB
|
47 lines
program SortDemo;
(***********************************)
(* TPDB *)
(***********************************)
(* Object -Oriented *)
(* Borland/Turbo Pascal Units *)
(* for Accessing dBASE III *)
(* files. *)
(* Copyright 1988 - 1993 *)
(* Brian Corll *)
(* All Rights Reserved *)
(***********************************)
(* FREEWARE *)
(***********************************)
(* dBASE is a registered *)
(* trademark of Borland Int. Inc. *)
(* Version 3.35 November, 1993 *)
(***********************************)
(* Portions Copyright 1984,1991 *)
(* Borland International Corp. *)
(***********************************)
uses
Crt, TPDB, TPDBSort, TPDBStr;
{Declare a FAR function which creates the sort key expression.}
{This function MUST call the SortFile object, as shown.}
{$F+}
function MakeKey: DBKey; {This function MUST return the type DBKey !}
begin
MakeKey := For2Eng(SortFile^.Field(1), ForTable, EngTable);
end;
{$F-}
begin
Writeln('Sorting TEST.DBF to SORT.DBF....'); {Set the VAR SortFunc equal to the sort key function.}
SortFunc := MakeKey; {Then call the sort with the SortFunc VAR and the input and
output files.}
SortOn(SortFunc, 'test.dbf', 'sort.dbf');
Writeln('Sort complete ! TPDB Version 3.35');
end.